package com.sright.bcard.content.dal.dao.impl;

import com.sright.bcard.common.service.share.base.dao.BaseDAOImpl;
import com.sright.bcard.common.service.share.base.dao.BaseMapper;
import com.sright.bcard.content.dal.dao.TagLibraryDAO;
import com.sright.bcard.content.dal.entity.TagLibraryDO;
import com.sright.bcard.content.dal.mapper.TagLibraryDOMapper;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository
public class TagLibraryDAOImpl extends BaseDAOImpl<TagLibraryDO> implements TagLibraryDAO {

    @Resource
    private TagLibraryDOMapper tagLibraryMapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return tagLibraryMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int deleteByPrimaryKeyAndEnterpriseId(Long id, Long enterpriseId) {
        return tagLibraryMapper.deleteByPrimaryKeyAndEnterpriseId(id, enterpriseId);
    }

    @Override
    public List<TagLibraryDO> selectByEnterpriseId(Long enterpriseId) {
        return tagLibraryMapper.selectByEnterpriseId(enterpriseId);
    }

    @Override
    public List<TagLibraryDO> selectTagsLikeName(Long enterpriseId, String name) {
        return tagLibraryMapper.selectTagsLikeName(enterpriseId, name);
    }

    @Override
    public List<TagLibraryDO> selectByIds(List<Long> userTagIdList) {
        return tagLibraryMapper.selectByIds(userTagIdList);
    }

    @Override
    protected BaseMapper<TagLibraryDO> getObjMapper() {
        return tagLibraryMapper;
    }
}
